#ifndef ICONTEXT_H
#define ICONTEXT_H

#include <QtCore/QObject>

QT_BEGIN_NAMESPACE
class QWidget;
QT_END_NAMESPACE

namespace CodeEdit {

class IContext : public QObject
{
    Q_OBJECT

public:
    IContext(QObject *parent = 0) : QObject(parent) { }
    virtual ~IContext() { }

    virtual QList<int> context() const = 0;
    virtual QWidget *widget() = 0;
    virtual QString contextHelpId() const { return QString(); }
};

class BaseContext : public IContext
{
public:
    BaseContext(QWidget *widget, const QList<int> &context, QObject *parent = 0)
        : IContext(parent)
        , _widget(widget)
        , _context(context) { }

    inline QList<int> context() const { return _context; }

    inline QWidget *widget() { return _widget; }

private:
    QWidget *_widget;
    QList<int> _context;
};

} // namespace CodeEdit

#endif // ICONTEXT_H
